<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>管理中心 - Powered By BETOU.NET</title>
<meta name="author" content="BETOU.NET Team" />
<meta name="copyright" content="BETOU.NET" />
<link href="${base}/res/betou/css/common.css" rel="stylesheet" type="text/css"/>
<link href="${base}/res/betou/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/res/common/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="${base}/res/common/js/common.js"></script>

<style type="text/css">
*{
	font: 12px tahoma, Arial, Verdana, sans-serif;
}
html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
}
</style>
<script type="text/javascript">
$().ready(function() {

	var $nav = $("#nav a:not(:last)");
	var $menu = $("#menu dl");
	var $menuItem = $("#menu a");
	var $logout = $("#logout");
	var $logoutForm = $("#logoutForm");
	
	$logout.click(function(){
			var $this = $(this);
			$.dialog({
				type: "warn",
				content: "<@s.m 'global.confirm.logout'/>",
				onOk: function() {
					$logoutForm.submit();
				}
			});
			return false;
	});
	
	$nav.click(function() {
		var $this = $(this);
		$nav.removeClass("current");
		$this.addClass("current");
		var $currentMenu = $($this.attr("href"));
		$menu.hide();
		$currentMenu.show();
		return false;
	});
	
	$menuItem.click(function() {
		var $this = $(this);
		$menuItem.removeClass("current");
		$this.addClass("current");
	});
	countUnreadMsg();
});

setTimeout( "countUnreadMsg() ",1000*60*10); 

function countUnreadMsg(){
	 $.post("message/v_countUnreadMsg.do", {
		}, function(data) {
			if(data.result){
				 $("#countDiv").html(""+data.count+"");
			}else{
				$.message("error", "<@s.m 'cmsMessage.noLogin'/>");
			}
		}, "json");
	 setTimeout( "countUnreadMsg() ",1000*60*10);    
}

function mapDialog(){
	var result=window.showModalDialog("map.do","","dialogHeight:600px;dialogWidth:800px;center:yes;resizable: yes;");
	if(result!=null){
		var href=result.split(";")[0];
		var target=result.split(";")[1];
		if(target=="rightFrame"){
				window.parent.mainFrame.document.getElementById(target).src=href;
				var rightFrameSrc=window.parent.mainFrame.document.getElementById(target).src;
				 if(rightFrameSrc.indexOf("frame")>=0){
					window.parent.mainFrame.document.getElementById(target).src=rightFrameSrc.split("frame/")[0]+rightFrameSrc.split("frame/")[1];
					}
			}
		else {
			 	window.parent.document.getElementById(target).src=href;
			}
		}
}

</script>
</head>
<body>
	<script type="text/javascript">
		if (self != top) {
			top.location = self.location;
		};
	</script>
	<form id="logoutForm" action="logout.do?returnUrl=index.do"></form>
	<table class="main">
		<tr>
			<th class="logo">
				<a href="main.jhtml">
					<img src="${base}/res/betou/images/header_logo.gif" alt="BETOU.NET" />
				</a>
			</th>
			<th>
				<div id="nav" class="nav">
					<ul>
						<@cms_perm url="/frame/channel_main.do">			
						<li><a href="frame/channel_main.do" target="rightFrame"><@s.m "cms.function.channel"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/content_main.do">
						<li><a href="frame/content_main.do" target="rightFrame"><@s.m "cms.function.content"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/template_main.do">
						<li><a href="frame/template_main.do" target="rightFrame"><@s.m "cms.function.template"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/resource_main.do">
						<li><a href="frame/resource_main.do" target="rightFrame"><@s.m "cms.function.resource"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/assistant_main.do">
						<li><a href="frame/assistant_main.do" target="rightFrame"><@s.m "cms.function.assistant"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/maintain_main.do">
						<li><a href="frame/maintain_main.do" target="rightFrame"><@s.m "cms.function.maintain"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/generate_main.do">
						<li><a href="frame/generate_main.do" target="rightFrame"><@s.m "cms.function.generate"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/user_main.do">
						<li><a href="frame/user_main.do" target="rightFrame"><@s.m "cms.function.user"/></a></li>
						</@cms_perm>
						<@cms_perm url="/frame/config_main.do">
						<li><a href="frame/config_main.do" target="rightFrame"><@s.m "cms.function.config"/></a></li>
						</@cms_perm>		
						<li><a href="index.do" target="rightFrame"><@s.m "global.admin.home"/></a></li>
					</ul>
				</div>
				<div class="link">
					<a href="javascript:;" onclick="mapDialog()">【网站地图】</a>|
					<a href="http://www.betou.net" target="_blank">官方网站</a>|
					<a href="http://www.betou.net/about.html" target="_blank">关于我们</a>
				</div>
				<div class="link">
					<@s.ma code="global.admin.welcome" args=[user.username]/>
					<@cms_perm url="/personal/v_profile.do">
					<a href="personal/v_profile.do" target="rightFrame">[<@s.m "cmsPersonal.function"/>]</a>
					</@cms_perm>
		
					<a href="javascript:;" id="logout">[<@s.m "global.admin.logout"/>]</a>
					<a href="message/v_list.do" title="最新消息">[<img src="${base}/res/betou/images/message.gif"/>消息<span id="countDiv" class="red"></span>]</a>
				</div>
			</th>
		</tr>
		<tr>
			<td id="menu" class="menu">
				<iframe noresize="noresize" id="leftFrame" name="leftFrame" src="left.do"  frameborder="0"></iframe>
			</td>
			<td>
				<iframe name="rightFrame" id="rightFrame"  src="right.do" frameborder="0"></iframe>
			</td>
		</tr>
	</table>
</body>
</html>